<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script>
window.wFn = {
	callBack:null,
	winCount : 0,
	/**
	*自定义弹出框
	*/
    dialog: null,
	/**
	*新增
	*/
	win:function(param){
		this.winCount ++;
		var _p = {
			title : "新窗口_"+ this.winCount , width : 400, height : 300, href : null,
			buttons : [ wFn.buttons.submit, wFn.buttons.close ]
		};
		_p = $.extend(_p,param || {});
		this.callBack = _p.callBack || null;
		wFn.dialog = $("<div/>").dialog("openWin", _p);
	},
	/**常用表单按钮操作*/
	buttons:{
		close:{
			text : "关闭", iconCls : "icon-no", handler : function() {
				wFn.dialog.dialog('close');
			}
		},
		submit:{
			text : "选择完成提交", iconCls : "icon-edit", handler : function() {
				var items = wFn.dialog.iframeWindow.choose();
				if(items && wFn.callBack){
					wFn.callBack(items);
				}
				wFn.dialog.dialog('close');
			}
		},
		clear:{
			text : "清空", iconCls : "icon-reload", handler : function() {
				wFn.dialog.iframeWindow.fn.clearForm();
			}
		}
	}
};
</script>